<!DOCTYPE html>



  


<html class="theme-next muse use-motion" lang="">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT" />










<meta name="description" content="HTML（HypeText Markup language）超文本标记语言 版本历史：HTML 的版本（W3C 组织制定规范）1.HTML 4.012.XHTML3.HTML 5（与H5没关系，可以运行在微信上的网页就叫H5）4.HTML 5.1（已经发布）HTML specifications标准文档由W3C组织编写 DOCTYPE用来选择文档类型html / head / body省略标签常见">
<meta property="og:type" content="article">
<meta property="og:title" content="HTML常用标签">
<meta property="og:url" content="http://yoursite.com/2018/03/20/十-HTML常用标签/index.html">
<meta property="og:site_name" content="From&#39;s blog">
<meta property="og:description" content="HTML（HypeText Markup language）超文本标记语言 版本历史：HTML 的版本（W3C 组织制定规范）1.HTML 4.012.XHTML3.HTML 5（与H5没关系，可以运行在微信上的网页就叫H5）4.HTML 5.1（已经发布）HTML specifications标准文档由W3C组织编写 DOCTYPE用来选择文档类型html / head / body省略标签常见">
<meta property="og:locale" content="default">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/11007474-ddd398b6c254b935.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/600">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/11007474-eb9e1cf2d70be7a1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/600">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/11007474-a82d1f2aa92fc681.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/11007474-c15373207d9f5b50.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/11007474-c0bbdae019586e73.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/11007474-57bc84d14d1b7e14.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="https://upload-images.jianshu.io/upload_images/11007474-ba2822a140b1cbf8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:updated_time" content="2018-03-31T13:22:15.224Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="HTML常用标签">
<meta name="twitter:description" content="HTML（HypeText Markup language）超文本标记语言 版本历史：HTML 的版本（W3C 组织制定规范）1.HTML 4.012.XHTML3.HTML 5（与H5没关系，可以运行在微信上的网页就叫H5）4.HTML 5.1（已经发布）HTML specifications标准文档由W3C组织编写 DOCTYPE用来选择文档类型html / head / body省略标签常见">
<meta name="twitter:image" content="https://upload-images.jianshu.io/upload_images/11007474-ddd398b6c254b935.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/600">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: 'Author'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2018/03/20/十-HTML常用标签/"/>





  <title>HTML常用标签 | From's blog</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="default">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">From's blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            Archives
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/03/20/十-HTML常用标签/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wang hang">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="From's blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">HTML常用标签</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2018-03-20T22:21:16+08:00">
                2018-03-20
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h1 id="HTML（HypeText-Markup-language）超文本标记语言"><a href="#HTML（HypeText-Markup-language）超文本标记语言" class="headerlink" title="HTML（HypeText Markup language）超文本标记语言"></a>HTML（HypeText Markup language）超文本标记语言</h1><ul>
<li>版本历史：<br>HTML 的版本（W3C 组织制定规范）<br>1.HTML 4.01<br>2.XHTML<br>3.HTML 5（与H5没关系，可以运行在微信上的网页就叫H5）<br>4.HTML 5.1（已经发布）<br><a href="https://www.w3.org/TR/html52/" target="_blank" rel="noopener">HTML specifications标准文档</a>由W3C组织编写</li>
<li>DOCTYPE<br>用来选择文档类型<br>html / head / body<br>省略标签<br>常见标签：<strong>a、form、input、button、h1、p、ul、ol、small、strong、div、span、kbd、video、audio、svg</strong><br>基本上，你知道标签对应单词的意思，就知道这个标签怎么用了（语义化）<br>除了 div 和 span，其他标签都有默认样式<br>html标签<br>如果开始不是一个注释，开头标签可以省略<br>如果结尾不是一个注释，那么结尾标签也可以省略</li>
<li>head标签<br>根据协议规定，在没有内容的情况下是可以省略的</li>
<li>body标签<br>只要第一个不是空格且没有注释的情况下也是可以不写的<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">**&lt;a&gt; anchor 锚点</span><br><span class="line">&lt;form&gt; 表单</span><br><span class="line">&lt;input&gt; 输入</span><br><span class="line">&lt;buttom&gt; 点击</span><br><span class="line">&lt;h1&gt;主标题</span><br><span class="line">&lt;p&gt;paragraph段落</span><br><span class="line">&lt;ul&gt;unordered list 没有顺序的列表</span><br><span class="line">&lt;ol&gt;ordered list 有顺序的列表</span><br><span class="line">&lt;dl&gt;description list 描述列表</span><br><span class="line">&lt;dt&gt;description term 描述词语</span><br><span class="line">&lt;dd&gt;定义</span><br><span class="line">&lt;small&gt;不重要的字</span><br><span class="line">&lt;strong&gt; 重要的字（有情感，逻辑）&lt;bold&gt;（物理状态）</span><br><span class="line">&lt;div&gt;divide 划分（没有任何意义的标签class）</span><br><span class="line">&lt;span&gt; 横向的划分（没有任何意义的标签，需要搭配class）</span><br><span class="line">&lt;kbd&gt; keyboard键盘</span><br><span class="line">&lt;video&gt; 视频</span><br><span class="line">&lt;audio&gt; 音频</span><br><span class="line">&lt;svg&gt; Scalable Vector Graphics不规则的图形</span><br><span class="line">&lt;alt&gt; alternative可选内容**</span><br></pre></td></tr></table></figure>
</li>
</ul>
<p>除了 div 和 span，其他标签都有默认样式</p>
<ul>
<li>a标签<br>download属性：表示是用来下载<br>跳转页面发起的是GET（获取）请求</li>
<li>form<br>跳转页面一般发起的是POST（上传）请求<br>如果form表单里面没有【提交按钮】就无法提交这个form<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&lt;form action=&quot;user&quot; method=&quot;POST&quot;&gt;  </span><br><span class="line">&lt;input type=&quot;text&quot; name=&quot;username&quot;&gt;  </span><br><span class="line">&lt;input type=&quot;password&quot; name=&quot;password&quot;&gt;  </span><br><span class="line">&lt;input type=&quot;submit&quot; value=&quot;提交&quot;&gt;  </span><br><span class="line">&lt;/form&gt;</span><br></pre></td></tr></table></figure>
</li>
</ul>
<h2 id="type"><a href="#type" class="headerlink" title="type"></a>type</h2><ul>
<li>button<br><code>&lt;button&gt;button&lt;/button&gt;</code>如果没有type默认升级为subline<br><code>&lt;button type=&quot;button&quot;&gt;button&lt;/button&gt;</code>没有提交作用</li>
<li>checkbox<br><img src="https://upload-images.jianshu.io/upload_images/11007474-ddd398b6c254b935.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/600" alt="image.png"><br>设置label for与input的ID进行关联，此时点击文字就能勾选<br>老司机是这样写的用<code>label</code>将<code>input</code>包起来就可以达到和上面同样的效果<br><img src="https://upload-images.jianshu.io/upload_images/11007474-eb9e1cf2d70be7a1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/600" alt="image.png"></li>
<li>radio 单选<br>只能选择一个，前提是name要设定一致</li>
<li>-select 下拉列表<br><img src="https://upload-images.jianshu.io/upload_images/11007474-a82d1f2aa92fc681.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"><br>disable不可以选择，selecated默认选择<br>value是空  则没有值<br>select中如果添加一个multiple则可以多选<br><img src="https://upload-images.jianshu.io/upload_images/11007474-c15373207d9f5b50.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"></li>
<li>textarea 文本域<br>一定要给一个name否则无法提交<br>resize：none设置不可以被拉伸，用CSS设置宽高<h2 id="table-表格"><a href="#table-表格" class="headerlink" title="table 表格"></a>table 表格</h2></li>
<li>th（table row）表示表头  td（table data）表示信息<br>colgroup中col设置每一列宽高<br><img src="https://upload-images.jianshu.io/upload_images/11007474-c0bbdae019586e73.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"></li>
<li><thead><tbody><tfoot>的顺序不影响呈现出的内容<br>CSS中加入<code>border-collapse：collapse；</code>可以使表格直接的空隙取消<br><img src="https://upload-images.jianshu.io/upload_images/11007474-57bc84d14d1b7e14.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">&lt;table&gt;    </span><br><span class="line">    &lt;thead&gt;</span><br><span class="line">        &lt;tr&gt;</span><br><span class="line">            &lt;th&gt;姓名&lt;/th&gt;&lt;th&gt;学校&lt;/th&gt;&lt;th&gt;年级&lt;/th&gt;&lt;th&gt;班级&lt;/th&gt;</span><br><span class="line">        &lt;/tr&gt;</span><br><span class="line">    &lt;/thead&gt;</span><br><span class="line">    &lt;tbody&gt;</span><br><span class="line">        &lt;tr&gt;</span><br><span class="line">            &lt;th&gt;小红&lt;/th&gt;&lt;td&gt;育红小学&lt;/td&gt;&lt;td&gt;三年级&lt;/td&gt;&lt;td&gt;七班&lt;/td&gt;</span><br><span class="line">        &lt;/tr&gt;</span><br><span class="line">    &lt;/tbody&gt;</span><br><span class="line">    &lt;tfoot&gt;</span><br><span class="line">        &lt;tr&gt;</span><br><span class="line">            &lt;th&gt;小明&lt;/th&gt;&lt;td&gt;育红小学&lt;/td&gt;&lt;td&gt;三年级&lt;/td&gt;&lt;td&gt;八班&lt;/td&gt;</span><br><span class="line">        &lt;/tr&gt;</span><br><span class="line">    &lt;/tfoot&gt;</span><br><span class="line">&lt;/table&gt;</span><br></pre></td></tr></table></figure>
</tfoot></tbody></thead></li>
</ul>
<p><img src="https://upload-images.jianshu.io/upload_images/11007474-ba2822a140b1cbf8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="image.png"></p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/03/20/九.Node.js Server/" rel="next" title="Node.js Server">
                <i class="fa fa-chevron-left"></i> Node.js Server
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/03/23/十一-CSS学习方法及常用属性/" rel="prev" title="CSS学习方法及常用属性">
                CSS学习方法及常用属性 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            Overview
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">Wang hang</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">52</span>
                  <span class="site-state-item-name">posts</span>
                </a>
              </div>
            

            

            
              
              
              <div class="site-state-item site-state-tags">
                
                  <span class="site-state-item-count">2</span>
                  <span class="site-state-item-name">tags</span>
                
              </div>
            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#HTML（HypeText-Markup-language）超文本标记语言"><span class="nav-number">1.</span> <span class="nav-text">HTML（HypeText Markup language）超文本标记语言</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#type"><span class="nav-number">1.1.</span> <span class="nav-text">type</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#table-表格"><span class="nav-number">1.2.</span> <span class="nav-text">table 表格</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Wang hang</span>

  
</div>


  <div class="powered-by">Powered by <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a></div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">Theme &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Muse</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
